from yuekaomoni2.Base import Base
from selenium.webdriver.common.by import By
from time import sleep

class Page(Base):
    #进入框架
    kuangjia=(By.XPATH,'/html/body/div[3]/div[3]/div[1]/div/div[3]/div[1]/div[2]/iframe')
    def info_kuangjia(self):
        self.iframe(self.kuangjia)

    #输入用户名
    phone=(By.NAME,'email')
    def send_phone(self):
        self.send_keys(self.phone,'lfc2314336117')

    #输入密码
    mima=(By.NAME,'password')
    def send_mima(self):
        self.send_keys(self.mima,'Lfc20041117')

    #登录按钮
    button_login=(By.ID,'dologin')
    def login_button(self):
        self.click(self.button_login)

    def a126_login(self):
        self.open_url('https://126.com/')
        sleep(2)
        self.info_kuangjia()
        sleep(2)
        self.send_phone()
        sleep(2)
        self.send_mima()
        sleep(2)
        self.login_button()
        sleep(5)